digraph all_service {
edge [fontname="Microsoft YaHei"];
node [shape=box,peripheries=2 fontname="Microsoft YaHei" style=filled]

<#if service.publicAccess>
    <#assign peripheries="2">
<#else>
    <#assign peripheries="1">
</#if>
<#if service.introduced>
    <#assign fontcolor="purple">
<#else>
    <#assign fontcolor="black">
</#if>
<#if service.database>
    <#assign shape="house">
    <#assign fillColor="GoldEnrod">
<#else>
    <#assign shape="ellipse">
    <#assign fillColor="Moccasin">
</#if>
${service.name} [label = "${service.title}",color="${fillColor}",peripheries="${peripheries}",fontcolor="${fontcolor}",shape="${shape}" ]
<#list service.relations as relation>
    <#if relation.serviceB.publicAccess>
        <#assign peripheries="2">
    <#else>
        <#assign peripheries="1">
    </#if>
    <#if relation.serviceB.introduced>
        <#assign fontcolor="purple">
    <#else>
        <#assign fontcolor="black">
    </#if>
    <#if relation.serviceB.database>
        <#assign shape="house">
        <#assign fillColor="GoldEnrod">
    <#else>
        <#assign shape="ellipse">
        <#assign fillColor="Moccasin">
    </#if>

${relation.serviceB.name} [label = "${relation.serviceB.title}",color="${fillColor}",peripheries="${peripheries}",fontcolor="${fontcolor}",shape="${shape}" ]
</#list>

<#list service.relations as relation>
    <#if relation.relationType == "PullFrom">
        <#assign color="blue">
        <#assign arraw="inv">
    <#elseif relation.relationType == "PushTo">
        <#assign color="green">
        <#assign arraw="normal">
    <#else>
        <#assign color="black">
        <#assign arraw="normal">
    </#if>
${relation.nameA} -> ${relation.nameB} [label="${relation.desc}",fontsize="8",color="${color}",arrowhead="${arraw}"]
</#list>
}